package com.xkdx.caipiao.presistence.faild;

import java.util.ArrayList;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xkdx.caipiao.module.network.AbsModule;

public class FaildModule extends AbsModule {
	public ArrayList<FaildInfo> list1;
	

	@Override
	public void parseData() throws Exception {
		try {
			backJson = (JSONArray) result;
			for (int i = 0; i < backJson.size(); i++) {
				jsonObj = (JSONObject) backJson.get(i);
				String sortOfAct = jsonObj.getString("Act");
				if (sortOfAct.equals("FaildOrderQuery")) {
					parseFaildOrderQuery(jsonObj.getJSONArray("DetailInfo"));
				}

			}
		} catch (Exception e) {
			throw e;
		}

	}

	private void parseFaildOrderQuery(JSONArray jsonArray) throws Exception {
		try {
			list1 = new ArrayList<FaildInfo>();
			JSONArray array = jsonArray;
			for (int i = 0; i < array.size(); i++) {

				JSONObject obj = array.getJSONObject(i);
				FaildInfo faildInfo = new FaildInfo();
				faildInfo.setOrdertime(obj.getString("ordertime"));
				faildInfo.setLotteryid(obj.getString("lotteryid"));
				faildInfo.setBetting(obj.getString("betting"));
				list1.add(faildInfo);
			}

		} catch (Exception e) {

			throw e;
		}
	}
}
